<template>
  <div>
    <form action="/">
      <van-search
        v-model="value"
        show-action
        placeholder="请输入影城名称"
        @search="onSearch"
        @cancel="onCancel"
      />
    </form>
    <div class="near">
      <div class="word">离你最近</div>
      <div class="square" v-for="item in 4">北京地质礼堂学院</div>
    </div>
  </div>
</template>

<script lang="ts">
import { ref } from "vue";
import { showToast } from "vant";
import { useRouter } from "vue-router";

export default {
  setup() {
    const value = ref("");
    const router = useRouter();
    const onSearch = (val) => showToast(val);
    const onCancel = () => router.push("/cirema/home");
    return {
      value,
      onSearch,
      onCancel,
    };
  },
};
</script>

<style scoped>
.van-search--show-action {
  padding-right: 12px;
}
.near {
  width: 100%;
  padding: 15px;
  box-sizing: border-box;
}
.word {
  font-size: 16px;
}
.square {
  font-size: 13px;
  background-color: rgb(245, 245, 245);
  padding: 10px;
  box-sizing: border-box;
  margin-right: 10px;
  float: left;
  margin-top: 10px;
}
</style>
